<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - /home/jkbs/src/zpr/imageeditor/ged/Command.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../../index.html">directory</a> - <a href="index.html">home/jkbs/src/zpr/imageeditor/ged</a> - Command.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">2</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">100.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">2</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : /*
<span class="lineNum">       2 </span>                :  *  \author Marcin Krzewski
<span class="lineNum">       3 </span>                :  *  \author Katarzyna Rusinowska 
<span class="lineNum">       4 </span>                :  *  \author Jakub Sitnicki   
<span class="lineNum">       5 </span>                :  *  \date    06/2009
<span class="lineNum">       6 </span>                :  */
<span class="lineNum">       7 </span>                : 
<span class="lineNum">       8 </span>                : #ifndef _COMMAND_HPP_
<span class="lineNum">       9 </span>                : #define _COMMAND_HPP_
<span class="lineNum">      10 </span>                : 
<span class="lineNum">      11 </span>                : #include &lt;boost/gil/gil_all.hpp&gt;
<span class="lineNum">      12 </span>                : 
<span class="lineNum">      13 </span>                : #include &quot;../ged/typedefs.hpp&quot;
<span class="lineNum">      14 </span>                : #include &quot;Image.hpp&quot;
<span class="lineNum">      15 </span>                : #include &quot;ImageLayer.hpp&quot;
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span>                : namespace ged {
<span class="lineNum">      18 </span>                : 
<span class="lineNum">      19 </span>                : //!Klasa czysto abstrakcyjna reprezentująca komendy
<span class="lineNum">      20 </span>                : class Command {
<span class="lineNum">      21 </span>                : public:
<span class="lineNum">      22 </span>                :         //! Konstruktor
<span class="lineNum">      23 </span><span class="lineCov">             12 :         Command(){}</span>
<span class="lineNum">      24 </span>                :         //! Wirtualny destruktor
<span class="lineNum">      25 </span><span class="lineCov">             10 :         virtual ~Command(){}</span>
<span class="lineNum">      26 </span>                :         //!Wykonanie komendy
<span class="lineNum">      27 </span>                :         virtual void execute(const PImage im) = 0;
<span class="lineNum">      28 </span>                :         //!Cofanie komendy
<span class="lineNum">      29 </span>                :         virtual void unExecute(const PImage im) = 0;
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : };
<span class="lineNum">      32 </span>                : //! Klasa reprezentująca komende odbicia obrazu góra/dół
<span class="lineNum">      33 </span>                : class FlipUpDownCommand: public Command {
<span class="lineNum">      34 </span>                : public:
<span class="lineNum">      35 </span>                :         //!Konstruktor
<span class="lineNum">      36 </span>                :         FlipUpDownCommand();
<span class="lineNum">      37 </span>                :         //!Wirtualny destruktor
<span class="lineNum">      38 </span>                :         virtual ~FlipUpDownCommand();
<span class="lineNum">      39 </span>                :         
<span class="lineNum">      40 </span>                :         //!Wykonanie komendy
<span class="lineNum">      41 </span>                :         /*
<span class="lineNum">      42 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">      43 </span>                :          *\sa FlipUpDownCommand::execute(const PImage im)
<span class="lineNum">      44 </span>                :         */
<span class="lineNum">      45 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">      46 </span>                :         
<span class="lineNum">      47 </span>                :         //!Cofanie komendy
<span class="lineNum">      48 </span>                :         /*
<span class="lineNum">      49 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">      50 </span>                :          *\sa FlipUpDownCommand::unExecute(const PImage im)
<span class="lineNum">      51 </span>                :         */
<span class="lineNum">      52 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">      53 </span>                : 
<span class="lineNum">      54 </span>                : };
<span class="lineNum">      55 </span>                : //! Klasa reprezentująca komende odbicia obrazu prawo/lewo
<span class="lineNum">      56 </span>                : class FlipLeftRightCommand: public Command {
<span class="lineNum">      57 </span>                : public:
<span class="lineNum">      58 </span>                :         //!Konstruktor
<span class="lineNum">      59 </span>                :         FlipLeftRightCommand();
<span class="lineNum">      60 </span>                :         //!Wirtulany destruktor
<span class="lineNum">      61 </span>                :         virtual ~FlipLeftRightCommand();
<span class="lineNum">      62 </span>                :         
<span class="lineNum">      63 </span>                :         //!Wykonanie komendy
<span class="lineNum">      64 </span>                :         /*
<span class="lineNum">      65 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">      66 </span>                :          *\sa FlipLeftRightCommand::execute(const PImage im)
<span class="lineNum">      67 </span>                :         */
<span class="lineNum">      68 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">      69 </span>                : 
<span class="lineNum">      70 </span>                :         //!Cofanie komendy
<span class="lineNum">      71 </span>                :         /*
<span class="lineNum">      72 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">      73 </span>                :          *\sa FlipUpDownCommand::unExecute(const PImage im)
<span class="lineNum">      74 </span>                :         */
<span class="lineNum">      75 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">      76 </span>                : 
<span class="lineNum">      77 </span>                : };
<span class="lineNum">      78 </span>                : //!Klasa reprezentująca komenende wycinania fragmentu obrazka
<span class="lineNum">      79 </span>                : class SubimageCommand: public Command {
<span class="lineNum">      80 </span>                : public:
<span class="lineNum">      81 </span>                :         //!Konstruktor
<span class="lineNum">      82 </span>                :         /*
<span class="lineNum">      83 </span>                :          *\param x_m y_m punkt rozpoczęcia wycinania
<span class="lineNum">      84 </span>                :          *\param w szerokość nowego obrazka 
<span class="lineNum">      85 </span>                :          *\param h wysokość nowego obrazka
<span class="lineNum">      86 </span>                :         */
<span class="lineNum">      87 </span>                :         SubimageCommand(int x_m ,int y_m, int w, int h);
<span class="lineNum">      88 </span>                :         //!Wirtualny destruktor
<span class="lineNum">      89 </span>                :         virtual ~SubimageCommand();
<span class="lineNum">      90 </span>                :         
<span class="lineNum">      91 </span>                :         //!Wykonanie komendy
<span class="lineNum">      92 </span>                :         /*
<span class="lineNum">      93 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">      94 </span>                :          *\sa SubimageCommand::execute(const PImage im)
<span class="lineNum">      95 </span>                :         */
<span class="lineNum">      96 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">      97 </span>                :         
<span class="lineNum">      98 </span>                :         //!Cofanie komendy
<span class="lineNum">      99 </span>                :         /*
<span class="lineNum">     100 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     101 </span>                :          *\sa SubimageCommand::unExecute(const PImage im)
<span class="lineNum">     102 </span>                :         */
<span class="lineNum">     103 </span>                :         virtual void unExecute(const PImage im) ;
<span class="lineNum">     104 </span>                : private:
<span class="lineNum">     105 </span>                :         //!Współrzędne (x,y) początek wycinania obrazku 
<span class="lineNum">     106 </span>                :         int x_min_;
<span class="lineNum">     107 </span>                :         int y_min_;
<span class="lineNum">     108 </span>                :         //!Nowa szerokość obrazka
<span class="lineNum">     109 </span>                :         int width_;
<span class="lineNum">     110 </span>                :         //!Nowa wysokość obrazka 
<span class="lineNum">     111 </span>                :         int height_;
<span class="lineNum">     112 </span>                :         //!Widok na obraz GIL skojarzony z komendą
<span class="lineNum">     113 </span>                :         GILImageView img_lay_view_;
<span class="lineNum">     114 </span>                :         
<span class="lineNum">     115 </span>                :         
<span class="lineNum">     116 </span>                : };
<span class="lineNum">     117 </span>                : //!Klasa reprezentująca próbkowanie w dziedzinie przestrzeni
<span class="lineNum">     118 </span>                : class SubsampleCommand: public Command{
<span class="lineNum">     119 </span>                : public:
<span class="lineNum">     120 </span>                :         //!Konstruktor
<span class="lineNum">     121 </span>                :         /*
<span class="lineNum">     122 </span>                :          *\param x krok proobkowania wzdłóż osi x
<span class="lineNum">     123 </span>                :          *\param y krok proobkowania wzdłóż osi y
<span class="lineNum">     124 </span>                :         */
<span class="lineNum">     125 </span>                :         SubsampleCommand(int x, int y);
<span class="lineNum">     126 </span>                :         
<span class="lineNum">     127 </span>                :         //!Wirtualny destruktor
<span class="lineNum">     128 </span>                :         virtual ~SubsampleCommand();
<span class="lineNum">     129 </span>                : 
<span class="lineNum">     130 </span>                :         //!Wykonanie komendy
<span class="lineNum">     131 </span>                :         /*
<span class="lineNum">     132 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     133 </span>                :          *\sa SubsampleCommande::execute(const PImage im)
<span class="lineNum">     134 </span>                :         */
<span class="lineNum">     135 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     136 </span>                : 
<span class="lineNum">     137 </span>                :         //!Cofanie komendy
<span class="lineNum">     138 </span>                :         /*
<span class="lineNum">     139 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     140 </span>                :          *\sa SubimageCommand::unExecute(const PImage im)
<span class="lineNum">     141 </span>                :         */
<span class="lineNum">     142 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     143 </span>                : 
<span class="lineNum">     144 </span>                : private:
<span class="lineNum">     145 </span>                :         //! x_step_ krok proobkowania wzdłóż osi x
<span class="lineNum">     146 </span>                :         int x_step_;
<span class="lineNum">     147 </span>                :         //! y_step_ krok proobkowania wzdłóż osi y
<span class="lineNum">     148 </span>                :         int y_step_;
<span class="lineNum">     149 </span>                :         //!Widok na obraz GIL skojarzony z komendą
<span class="lineNum">     150 </span>                :         GILImageView img_lay_view_;
<span class="lineNum">     151 </span>                :         
<span class="lineNum">     152 </span>                : };
<span class="lineNum">     153 </span>                : //!Klasa reprezentująca obrót obrazka w kierunku zgodnym z ruchem wskazówek zegra 
<span class="lineNum">     154 </span>                : class RotateCwCommand: public Command {
<span class="lineNum">     155 </span>                : public:
<span class="lineNum">     156 </span>                :         //!Konstruktor
<span class="lineNum">     157 </span>                :         RotateCwCommand();
<span class="lineNum">     158 </span>                :         //!Wirtulany destruktor
<span class="lineNum">     159 </span>                :         virtual ~RotateCwCommand();
<span class="lineNum">     160 </span>                :         
<span class="lineNum">     161 </span>                :         //!Wykonanie komendy
<span class="lineNum">     162 </span>                :         /*
<span class="lineNum">     163 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     164 </span>                :          *\sa RotateCwCommand::execute(const PImage im)
<span class="lineNum">     165 </span>                :         */
<span class="lineNum">     166 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     167 </span>                :         
<span class="lineNum">     168 </span>                :         //!Cofanie komendy
<span class="lineNum">     169 </span>                :         /*
<span class="lineNum">     170 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     171 </span>                :          *\sa RotateCwCommand::unExecute(const PImage im)
<span class="lineNum">     172 </span>                :         */
<span class="lineNum">     173 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span>                : };
<span class="lineNum">     176 </span>                : //!Klasa reprezentująca obrót obrazka w kierunku przeciwnym do ruchu wskazówek zegra
<span class="lineNum">     177 </span>                : class RotateCcwCommand: public Command {
<span class="lineNum">     178 </span>                : public:
<span class="lineNum">     179 </span>                :         //!Konstruktor
<span class="lineNum">     180 </span>                :         RotateCcwCommand();
<span class="lineNum">     181 </span>                :         //!Wirtulany destruktor
<span class="lineNum">     182 </span>                :         virtual ~RotateCcwCommand();
<span class="lineNum">     183 </span>                :         
<span class="lineNum">     184 </span>                :         //!Wykonanie komendy
<span class="lineNum">     185 </span>                :         /*
<span class="lineNum">     186 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     187 </span>                :          *\sa RotateCcwCommand::execute(const PImage im)
<span class="lineNum">     188 </span>                :         */
<span class="lineNum">     189 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     190 </span>                :         
<span class="lineNum">     191 </span>                :         //!Cofanie komendy
<span class="lineNum">     192 </span>                :         /*
<span class="lineNum">     193 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     194 </span>                :          *\sa RotateCcwCommand::unExecute(const PImage im)
<span class="lineNum">     195 </span>                :         */
<span class="lineNum">     196 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     197 </span>                : 
<span class="lineNum">     198 </span>                : };
<span class="lineNum">     199 </span>                : //!Klasa reprezentująca komendę wybory wyższej warstwy
<span class="lineNum">     200 </span>                : class SelectLayerAboveCommand: public Command {
<span class="lineNum">     201 </span>                : public:
<span class="lineNum">     202 </span>                :         //!Konstruktor
<span class="lineNum">     203 </span>                :         SelectLayerAboveCommand();
<span class="lineNum">     204 </span>                :         //!Wirtualny destruktor
<span class="lineNum">     205 </span>                :         virtual ~SelectLayerAboveCommand();
<span class="lineNum">     206 </span>                :         
<span class="lineNum">     207 </span>                :         //!Wykonanie komendy
<span class="lineNum">     208 </span>                :         /*
<span class="lineNum">     209 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     210 </span>                :          *\sa SelectLayerAboveCommand::execute(const PImage im)
<span class="lineNum">     211 </span>                :         */
<span class="lineNum">     212 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     213 </span>                :         
<span class="lineNum">     214 </span>                :         //!Cofanie komendy
<span class="lineNum">     215 </span>                :         /*
<span class="lineNum">     216 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     217 </span>                :          *\sa SelectLayerAboveCommand::unExecute(const PImage im)
<span class="lineNum">     218 </span>                :         */
<span class="lineNum">     219 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                : private:
<span class="lineNum">     222 </span>                :         //! chk_ sprwdzenie możliwości wykonania komendy 
<span class="lineNum">     223 </span>                :         bool chk_;
<span class="lineNum">     224 </span>                : };
<span class="lineNum">     225 </span>                : 
<span class="lineNum">     226 </span>                : //!Klasa reprezentująca komendę wybory niższej warstwy
<span class="lineNum">     227 </span>                : class SelectLayerBelowCommand: public Command {
<span class="lineNum">     228 </span>                : public:
<span class="lineNum">     229 </span>                :         //!Konstruktor
<span class="lineNum">     230 </span>                :         SelectLayerBelowCommand();
<span class="lineNum">     231 </span>                :         //!Wirtualny destruktor
<span class="lineNum">     232 </span>                :         virtual ~SelectLayerBelowCommand();
<span class="lineNum">     233 </span>                : 
<span class="lineNum">     234 </span>                :         //!Wykonanie komendy
<span class="lineNum">     235 </span>                :         /*
<span class="lineNum">     236 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     237 </span>                :          *\sa SelectLayerBelowCommand::execute(const PImage im)
<span class="lineNum">     238 </span>                :         */
<span class="lineNum">     239 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     240 </span>                : 
<span class="lineNum">     241 </span>                :         //!Cofanie komendy
<span class="lineNum">     242 </span>                :         /*
<span class="lineNum">     243 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     244 </span>                :          *\sa SelectLayerBelowCommand::unExecute(const PImage im)
<span class="lineNum">     245 </span>                :         */
<span class="lineNum">     246 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     247 </span>                : private:
<span class="lineNum">     248 </span>                :         //! chk_ sprwdzenie możliwości wykonania komendy 
<span class="lineNum">     249 </span>                :         bool chk_;
<span class="lineNum">     250 </span>                : };
<span class="lineNum">     251 </span>                : 
<span class="lineNum">     252 </span>                : //!Klasa reprezentująca komendę przesunięcia obrazka
<span class="lineNum">     253 </span>                : class MoveLayerCommand: public Command {
<span class="lineNum">     254 </span>                : public:
<span class="lineNum">     255 </span>                :         //!Konstruktor
<span class="lineNum">     256 </span>                :         /*
<span class="lineNum">     257 </span>                :          *\param x przesunięcie w kierunku osi x
<span class="lineNum">     258 </span>                :          *\param y przesunięcie w kierunku osi y
<span class="lineNum">     259 </span>                :         */
<span class="lineNum">     260 </span>                :         MoveLayerCommand(int x,int y);
<span class="lineNum">     261 </span>                :         
<span class="lineNum">     262 </span>                :         //! Wirtulany destruktor
<span class="lineNum">     263 </span>                :         virtual ~MoveLayerCommand();
<span class="lineNum">     264 </span>                :         
<span class="lineNum">     265 </span>                :         //!Wykonanie komendy
<span class="lineNum">     266 </span>                :         /*
<span class="lineNum">     267 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     268 </span>                :          *\sa MoveLayerCommand::execute(const PImage im)
<span class="lineNum">     269 </span>                :         */
<span class="lineNum">     270 </span>                :         virtual void execute(const PImage im);
<span class="lineNum">     271 </span>                :         
<span class="lineNum">     272 </span>                :         //!Cofanie komendy
<span class="lineNum">     273 </span>                :         /*
<span class="lineNum">     274 </span>                :          *\param im obrazek przechowujący wiele warstw
<span class="lineNum">     275 </span>                :          *\sa MoveLaye::unExecute(const PImage im)
<span class="lineNum">     276 </span>                :         */
<span class="lineNum">     277 </span>                :         virtual void unExecute(const PImage im);
<span class="lineNum">     278 </span>                :         
<span class="lineNum">     279 </span>                : private:
<span class="lineNum">     280 </span>                :         //! Przesunięcie warstwy względem obrazka
<span class="lineNum">     281 </span>                :         GILPoint offset_;
<span class="lineNum">     282 </span>                :         //! Margines przed wykonaniem komendy
<span class="lineNum">     283 </span>                :         GILPoint oldOffset_;
<span class="lineNum">     284 </span>                :         //! Przesunięcie w kierunku osi x
<span class="lineNum">     285 </span>                :         int x_;
<span class="lineNum">     286 </span>                :         //! Przesunięcie w kierunku osi y
<span class="lineNum">     287 </span>                :         int y_;
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                : };
<span class="lineNum">     290 </span>                : 
<span class="lineNum">     291 </span>                : }// namespace ged
<span class="lineNum">     292 </span>                : 
<span class="lineNum">     293 </span>                : #endif  // _COMMAND_HPP_
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
